﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using SalePartial.Utility;

public partial class controls_login_CADListCommbox : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public IList<RadListBoxItem> SelectedCadList
    {
        get
        {
            return rlbSoftware.CheckedItems;
        }
        set
        {
            foreach (RadListBoxItem item in value)
            {
                item.Checked = true;
            }
        }
    }


    public string SetSelectedString
    {
        set
        {
            if(value == string.Empty)
            {
                return;
            }
            string[] tmp = value.Split(new string[] { Constant.STR_SPLIT_LISTITEM }, StringSplitOptions.RemoveEmptyEntries);
            foreach (RadListBoxItem item in rlbSoftware.Items)
            {

                foreach (string text in tmp)
                {
                    if(item.Text == text)
                    {
                        item.Checked = true;
                        break;
                    }
                }
            }
        }
    }
}